import QtQuick 2.0

import "../../common"
import "../../../js/util.js" as Util
import "../../../js/UI.js" as Style

Rectangle{
    id: m_rec
    property alias m_source: m_image.source
    property alias m_name: m_curname.text
    property alias m_university: m_university.text
    property alias m_week: m_week.text
    property alias m_numbers: m_numbers.text
    signal clickedsignal()
    width: parent.width*0.9
    height: m_lineValue*2
    radius: 10
    anchors.horizontalCenter: parent.horizontalCenter
    Rectangle{
        id: m_image_rec
        height: parent.height*0.8
        width: height*1.2
        radius: 10
        color: "transparent"
        anchors.left: parent.left
        anchors.leftMargin: 0.2*m_lineValue
        anchors.verticalCenter: parent.verticalCenter
        Image {
            id: m_image
            anchors.verticalCenter: parent.verticalCenter
            sourceSize.height: parent.height
            sourceSize.width: parent.width
            fillMode: Image.TileHorizontally
        }
    }
    Rectangle{
        id: m_text
        height: parent.height*0.7
        color: "transparent"
        anchors.left: m_image_rec.right
        anchors.leftMargin: 0.2*m_lineValue
        anchors.right: parent.right
        anchors.rightMargin: 0.2*m_lineValue
        anchors.verticalCenter: parent.verticalCenter
        AText{
            id: m_curname
            anchors.top: parent.top
            anchors.left: parent.left
            font.pointSize: 14
            color: "#000000"
        }
        AText{
            id: m_university
            anchors.top: m_curname.bottom
            anchors.topMargin: 0.1*m_lineValue
            anchors.left: parent.left
            font.pointSize: 12
            color: "#74787c"
        }
        Image{
            id: m_time
            anchors.left: parent.left
            anchors.bottom: parent.bottom
            sourceSize: Qt.size(m_lineValue*0.5,m_lineValue*0.5)
            source: "qrc:/image/curriculum/m_time.png"
        }

        AText{
            id: m_week
            anchors.left: m_time.right
            anchors.bottom: parent.bottom
            anchors.bottomMargin: 0.1*m_lineValue
            font.pointSize: 12
            color: "#1afa29"
        }
        AText{
            id: m_numbers
            anchors.right: parent.right
            anchors.rightMargin: 0.2*m_lineValue
            anchors.bottom: parent.bottom
            font.pointSize: 12
            color: "#74787c"
        }
    }
    MouseArea{
        anchors.fill: parent
        onClicked: {
            clickedsignal()
        }
    }
}
